import 'dart:convert' show json;

class HomeListResponse {

  bool result;
  String code;
  String message;
  List<HomeListData> data;

  HomeListResponse.fromParams({this.result, this.code, this.message, this.data});

  factory HomeListResponse(jsonStr) => jsonStr == null ? null : jsonStr is String ? new HomeListResponse.fromJson(json.decode(jsonStr)) : new HomeListResponse.fromJson(jsonStr);

  HomeListResponse.fromJson(jsonRes) {
    result = jsonRes['result'];
    code = jsonRes['code'];
    message = jsonRes['message'];
    data = jsonRes['data'] == null ? null : [];

    for (var dataItem in data == null ? [] : jsonRes['data']){
      data.add(dataItem == null ? null : new HomeListData.fromJson(dataItem));
    }
  }

  @override
  String toString() {
    return '{"result": $result,"code": ${code != null?'${json.encode(code)}':'null'},"message": ${message != null?'${json.encode(message)}':'null'},"data": $data}';
  }
}

class HomeListData {

  int bisDelete;
  int clickNum;
  int clickWeight;
  int createTime;
  int id;
  int itemId;
  int likeNum;
  int likeWeight;
  int mediaType;
  int shareNum;
  int shareWeight;
  int ts;
  String gifPath;
  String name;
  String picPath;
  String uuid;

  HomeListData.fromParams({this.bisDelete, this.clickNum, this.clickWeight, this.createTime, this.id, this.itemId, this.likeNum, this.likeWeight, this.mediaType, this.shareNum, this.shareWeight, this.ts, this.gifPath, this.name, this.picPath, this.uuid});

  HomeListData.fromJson(jsonRes) {
    bisDelete = jsonRes['bisDelete'];
    clickNum = jsonRes['clickNum'];
    clickWeight = jsonRes['clickWeight'];
    createTime = jsonRes['createTime'];
    id = jsonRes['id'];
    itemId = jsonRes['itemId'];
    likeNum = jsonRes['likeNum'];
    likeWeight = jsonRes['likeWeight'];
    mediaType = jsonRes['mediaType'];
    shareNum = jsonRes['shareNum'];
    shareWeight = jsonRes['shareWeight'];
    ts = jsonRes['ts'];
    gifPath = jsonRes['gifPath'];
    name = jsonRes['name'];
    picPath = jsonRes['picPath'];
    uuid = jsonRes['uuid'];
  }

  @override
  String toString() {
    return '{"bisDelete": $bisDelete,"clickNum": $clickNum,"clickWeight": $clickWeight,"createTime": $createTime,"id": $id,"itemId": $itemId,"likeNum": $likeNum,"likeWeight": $likeWeight,"mediaType": $mediaType,"shareNum": $shareNum,"shareWeight": $shareWeight,"ts": $ts,"gifPath": ${gifPath != null?'${json.encode(gifPath)}':'null'},"name": ${name != null?'${json.encode(name)}':'null'},"picPath": ${picPath != null?'${json.encode(picPath)}':'null'},"uuid": ${uuid != null?'${json.encode(uuid)}':'null'}}';
  }
}

